using System;
using System.Collections.Generic;
using Cysharp.Threading.Tasks;

namespace EventBus
{
    /// <summary>
    /// 以异步的方式监听事件， 且允许有用返回值
    /// </summary>
    public partial class EventBusImpl
    {
        public void Listen<TResult>(string eventName, Func<UniTask<TResult>> callback)
        {
            ListenImpl(eventName, callback);
        }

        public void Listen<T, TResult>(string eventName, Func<T, UniTask<TResult>> callback)
        {
            ListenImpl(eventName, callback);
        }

        public void Listen<T1, T2, TResult>(string eventName, Func<T1, T2, UniTask<TResult>> callback)
        {
            ListenImpl(eventName, callback);
        }

        public void Listen<T1, T2, T3, TResult>(string eventName, Func<T1, T2, T3, UniTask<TResult>> callback)
        {
            ListenImpl(eventName, callback);
        }

        public void Listen<T1, T2, T3, T4, TResult>(string eventName, Func<T1, T2, T3, T4, UniTask<TResult>> callback)
        {
            ListenImpl(eventName, callback);
        }

        public void Listen<T1, T2, T3, T4, T5, TResult>(string eventName, Func<T1, T2, T3, T4, T5, UniTask<TResult>> callback)
        {
            ListenImpl(eventName, callback);
        }

        public void Listen<T1, T2, T3, T4, T5, T6, TResult>(string eventName, Func<T1, T2, T3, T4, T5, T6, UniTask<TResult>> callback)
        {
            ListenImpl(eventName, callback);
        }

        public void Listen<T1, T2, T3, T4, T5, T6, T7, TResult>(string eventName, Func<T1, T2, T3, T4, T5, T6, T7, UniTask<TResult>> callback)
        {
            ListenImpl(eventName, callback);
        }

        public void Listen<T1, T2, T3, T4, T5, T6, T7, T8, TResult>(string eventName, Func<T1, T2, T3, T4, T5, T6, T7, T8, UniTask<TResult>> callback)
        {
            ListenImpl(eventName, callback);
        }
    }
}